package nzk.hssftemp;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.ss.usermodel.Font;

/**
 * Cell style for data / detail, support data formatting.
 *
 * @author N. Zulkarnaen (n.zulkarnaen@gmail.com)
 *         Date: 6/27/13
 *         Time: 6:13 PM
 * @version $Revision: 5 $
 */
public class CSDetail extends CSBase {

    void init(HSSFTemplate rpt, String format) {
        font.setFontHeightInPoints((short) 10);
        font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
        style.setWrapText(true);
        style.setBorderTop(HSSFCellStyle.BORDER_THIN);
        style.setBorderRight(HSSFCellStyle.BORDER_THIN);
        style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
        if (format != null) {
            style.setDataFormat(rpt.format.getFormat(format));
        }
    }

    public CSDetail(HSSFTemplate rpt, String format) {
        super(rpt);
        init(rpt, format);
    }

}
